<?php if (!defined("BASEPATH")) exit("No direct script access allowed");

class Preview {

	function __construct() {
		define("STUDY_PREVIEW", TRUE);
	}

	function _remap($param, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL) {
		/*
		echo "\$arg1 :<pre style=\"border:1px solid red;\">";
		print_r($arg1);
		echo "</pre>";
		echo "\$arg2 :<pre style=\"border:1px solid red;\">";
		var_dump($arg2);
		echo "</pre>";
		echo "\$arg3 :<pre style=\"border:1px solid red;\">";
		print_r($arg3);
		echo "</pre>";
		echo "\$arg4 :<pre style=\"border:1px solid red;\">";
		print_r($arg4);
		echo "</pre>";
		echo "\$arg5 :<pre style=\"border:1px solid red;\">";
		print_r($arg5);
		echo "</pre>";			
		
		echo $param;
		$args = func_get_args();
		echo "<pre>"; print_r($args); exit;
		exit;*/

		include_once("main.php");
		$main = new Main();
		if(is_null($arg1)) {
			$main->_remap($param);
		} else {
			$main->_remap($param, $arg1);
		}
		/*
		if(is_null($arg2)) {
			$main->_remap($param, $arg1);
		} elseif(is_null($arg3)) {
			$main->_remap($param, $arg1, $arg2);
		} elseif(is_null($arg4)) {
			$main->_remap($param, $arg1, $arg2, $arg3);
		} elseif(is_null($arg5)) {
			$main->_remap($param, $arg1, $arg2, $arg3, $arg4);
		} else {
			$main->_remap($param, $arg1, $arg2, $arg3, $arg4, $arg5);
		}
		*/
	}

}